package cn.linlane.entity.errors;

import org.springframework.http.HttpStatus;

/**
 * @author cheng
 * @date 2018-06-21 15:10
 */
public enum MyError {
    USER_EXISTS(1001, "用户已存在！", HttpStatus.CREATED),
    PARAM_CANT_BE_NULL(1002, "参数不能为空！", HttpStatus.BAD_REQUEST),
    SYSTEM_ERROR(1003,"系统异常！",HttpStatus.BAD_REQUEST),
    USER_NOT_LOGIN(1004, "用户未登录！", HttpStatus.FORBIDDEN),
    USER_NOT_EXISTS(1005, "用户不存在！", HttpStatus.NOT_FOUND),
    ROLE_EXISTS(1006, "角色已存在！", HttpStatus.CREATED),
    ROLE_NOT_EXISTS(1007, "角色不存在！", HttpStatus.NOT_FOUND),
    PASSWORD_WRONG(1008, "密码错误！", HttpStatus.BAD_REQUEST),
    DEPART_EXISTS(1009, "该部门编号已存在！", HttpStatus.CREATED),
    DEPART_NOT_EXISTS(1010, "该部门编号不存在！", HttpStatus.CREATED),
    ;

    private Integer errorCode;

    private String message;

    private HttpStatus httpStatus;

    MyError(Integer errorCode, String message, HttpStatus httpStatus) {
        this.errorCode = errorCode;
        this.message = message;
        this.httpStatus = httpStatus;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public String getMessage() {
        return message;
    }

    public HttpStatus getHttpStatus() {
        return httpStatus;
    }
}
